package com.agileai.bpm.webservice;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import com.agileai.bpm.domain.running.WorkItem;
import com.agileai.hotweb.common.ResultStatus;

@WebService(serviceName="ProcessService",name="ProcessService",portName="ProcessServicePort",targetNamespace="http://www.agileai.com/bpm/api")
public interface BPMService {
	@WebMethod
	public String getCurrentProcessId(@WebParam(name="processCode") String processCode);
	@WebMethod
	public String[] getProcessId8InstId(@WebParam(name="processCode") String processCode,@WebParam(name="bizRecordId") String bizRecordId);	
	
	@WebMethod
	public List<WorkItem> findWorkItems(@WebParam(name="userCode") String userCode);
	
	@WebMethod
	public ResultStatus launchProcess(@WebParam(name="launchWorkItem") LaunchWorkItem launchWorkItem,@WebParam(name="skipFirstNode")  boolean skipFirstNode);
	@WebMethod
	public ResultStatus submitProcess(@WebParam(name="submitWorkItem") SubmitWorkItem submitWorkItem);
	@WebMethod
	public ResultStatus invokeProcess(@WebParam(name="InvokeWorkItem") InvokeWorkItem invokeWorkItem);
	
	@WebMethod
	public ResultStatus terminateProcess(@WebParam(name="handleWorkItem") HandleWorkItem handleWorkItem);
	@WebMethod
	public ResultStatus suspendProcess(@WebParam(name="handleWorkItem") HandleWorkItem handleWorkItem);
	@WebMethod
	public ResultStatus resumeProcess(@WebParam(name="handleWorkItem") HandleWorkItem handleWorkItem);
	
	@WebMethod
	public ResultStatus delegateProcess(@WebParam(name="delegateWorkItem") DelegateWorkItem delegateWorkItem);
	
	@WebMethod
	public ResultStatus saveDraft(@WebParam(name="processCode")String processCode,@WebParam(name="bizRecordId") String bizRecordId,@WebParam(name="bizTitle") String bizTitle,@WebParam(name="userCode")String userCode);	
	
	@WebMethod
	public ProcessDefine retrieveProcessDefine(@WebParam(name="processId") String processId);
	
	@WebMethod
	public ProcessProfile retrieveProcessProfile(@WebParam(name="processInstId") String processInstId);
	
	@WebMethod
	public boolean isOwnTask(@WebParam(name="userCode") String userCode,@WebParam(name="processInsId") String processInsId,@WebParam(name="activityCode") String activityCode);
}